/*
 This program is submitted as part of an assignment in the
 J2E
 Fall Semester 2010-2011 
 School of Computer Science
 Interdisciplinary Center, Hertzelia, Israel 

 http://www.idc.ac.il 

 Exercise No.         : 3
 File Name            : BaseActivity.java
 Names (First Last)   : Itay Sorani, Nadav Ziv, Yonathan Zarsky
 Student No.          : 066530254, 039937883, 039692918
 */

package com.example;

import android.app.Activity;
import android.widget.TextView;

/**
 * The basic game activity of which all activities in the game will inherit
 */
public class BaseActivity extends Activity {

	/**
	 * returns the model
	 */
    protected Model getModel() {
        return ((GameApplication)getApplication()).getModel();
    }

    /**
     * updates the model's label
     */
    protected void updateLabel() {
        Model model = getModel();
        int value = model.getValue();
        String text = String.valueOf(value);
        TextView label = (TextView)findViewById(R.id.label);
        label.setText(text);
    }
}